package cn.edu.sdjzu.xg.bysj.domain;

import cn.edu.sdjzu.xg.bysj.domain.authority.Actor;
import lombok.*;
import util.IdService;

import java.io.Serializable;

@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@ToString
public final class Student extends Actor implements Comparable<Student>, Serializable {
    private Integer id;
    private String name;
    private String no;
    private StudentClass studentClass;
    //导师
    private Teacher supervisor;

    public String toString() {
        final String TAB = "    ";

        String retValue = "";

        retValue = "Student ( "
                + super.toString() + TAB
                + "id = " + this.id + TAB
                + "name = " + this.name + TAB
                + " no = " + this.no + TAB
                + "studentClass = " + this.studentClass + TAB
                + "supervisor = " + this.supervisor + TAB

                + " )";
        return retValue;
    }

    @Override
    public int compareTo(Student other) {
        // no为排序依据
        return this.no.compareTo(other.no);
    }
}
